home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 34.zip / BS1 part 34 / Aztec C 5.0a disk 1.adf / include / obj68k.h < prev    next >
C/C++ Source or Header  |  1989-08-10  |  5KB  |  169 lines

  1. /* Copyright Manx Software Systems, Inc. 1988.  All rights reserved */
  2.  
  3. #ifndef __OBJ68K_H 
  4. #define __OBJ68K_H 
  5.  
  6. /* Manx 680x0 version 4.9a */
  7.  
  8.     /* loader item definitions */
  9. #define SPEC2    0x00
  10. #define THEEND    0x00
  11.     /* special info for source level debugger */
  12. #define BLOCKST    0x01    /* block start */
  13. #define AUTOSYM    0x02    /* auto variable def */
  14. #define ARGSYM    0x03    /* function argument def */
  15. #define REGSYM    0x04    /* register variable def */
  16. #define AREGSYM    0x05    /* register var argument */
  17. #define STATSYM    0x06    /* static variable def */
  18. #define FILESYM    0x07    /* file scope static var def */
  19. #define GBLTYPE    0x08    /* global variable type info */
  20. #define TDEFSYM    0x09    /* typedef name */
  21. #define STRCTAG    0x0a    /* structure tag definition */
  22. #define STRCDEF    0x0b    /* start of structure definition */
  23. #define SETFILE 0x0c    /* set working file name for line table */
  24. #define SETLINE 0x0d    /* set current line # */
  25.  
  26. #define ABSDATA    0x10
  27. #define EXPR    0x20
  28. #define SMLINT    0x30
  29. #define SMLNEG    0x40
  30. #define MEDINT    0x50
  31. #define LCLSYM    0x60
  32. #define GBLSYM    0x70
  33. #define SPACE    0x80
  34. #define USECOMN    0x90
  35. #define CODEREF    0xa0
  36. #define DATAREF 0xb0
  37. #define BSSREF    0xc0
  38. #define SEGREL    0xd0        /* segment relative reference */
  39. #define SPECIAL    0xf0
  40. #define DATASEG    0xf0        /* para # of data segment (8086 only) */
  41. #define BEXPR    0xf1        /* byte expression */
  42. #define BREL    0xf2        /* 8-bit PC relative */
  43. #define LRGINT    0xf3
  44. #define USECODE    0xf4
  45. #define USEDATA    0xf5
  46. #define STARTAD    0xf6
  47. #define LRGCODE 0xf7
  48. #define LRGDATA 0xf8
  49. #define INTJSR    0xf9        /* interpreter call instruction */
  50. #define WREL    0xfa        /* 16-bit PC relative */
  51. #define LRGBSS    0xfb
  52. #define HUGINT    0xfc        /* 32-bit constant */
  53. #define LEXPR    0xfd        /* 32-bit address expression */
  54. #define CODESEG    0xfe        /* para # of code segment (8086 only) */
  55. #define    LREL    0xfe        /* 32-bit PC relative */
  56. #define NLINE    0xff
  57.  
  58.     /* within STRCDEF the following are used */
  59. #define MEMBDEF        0x01    /* structure member info */
  60. #define FLDDEF        0x02    /* bit field member */
  61.  
  62.     /* low nibble of EXPR item (operators) */
  63. #define ADD    1
  64. #define SUB    2
  65. #define MUL    3
  66. #define DIV    4
  67. #define MOD    5
  68. #define AND    6
  69. #define OR    7
  70. #define XOR    8
  71. #define RSH    9
  72. #define LSH    10
  73. #define NOT    11 /* must be the first unary op, and only unarys may follow */
  74. #define NEG    12
  75. #define OHIGH 13
  76. #define OLOW 14
  77. #define OSEG 15
  78. #define    FLP 15                /* flip the following word */
  79.  
  80. #define M_MAGIC        ((short)0x434a)
  81. #define M_LMAGIC    ((short)0x030c)
  82. #define M_OVROOT    ((short)0xcf56)
  83. #define M_LIBRARY    ((short)0x636a)
  84.  
  85. #define M_GRAIN        4    /* boundary for all positions in file */
  86. #define M_GRSHFT    2    /* log base 2 of GRAIN */
  87. #define M_SHIFT(x)    ((long)(x)<<M_GRSHFT)
  88.  
  89. struct module {
  90.     short m_magic;            /* magic number for object files */
  91.     char m_name[8];            /* module name */
  92.     long m_code;            /* size of code in this module */
  93.     long m_data;            /* size of data in this module */
  94.     long m_static;            /* size of static storage (bss) in this module */
  95.     short m_nglobal;        /* # of global symbols */
  96.     short m_nlocal;            /* # of local symbols */
  97.     unsigned short m_recs;    /* offset of start of module records */
  98.     unsigned short m_global;/* offset of start of global symbols */
  99.     unsigned short m_local;    /* offset of start of local symbols */
  100.     unsigned short m_next;    /* offset of next module in this file */
  101.     unsigned short m_nfix;    /* number of segment fixes required */
  102. };
  103.  
  104. #define LBSIZE (2048-2*sizeof(short))
  105.  
  106. struct newlib {
  107.     short nl_magic;        /* magic number for library files */
  108.     unsigned short nl_next;    /* location of next dictionary block */
  109.     char nl_dict[LBSIZE];        /* dictionary buffer */
  110.     /* the format of the dictionary is:
  111.         two bytes - (position of module defining symbol) / 128
  112.         nul terminated string - name of symbol
  113.     */
  114. };
  115.  
  116. #define S_ABS        1
  117. #define S_CODE        2
  118. #define S_DATA        3
  119. #define S_COMN        4        /* common segment (obsolete) */
  120. #define S_CMNREF    5
  121. #define S_ROOTSYM    6        /* used by linker to tag root symbols */
  122. #define S_EXPR        6
  123. #define S_UND        7
  124. #define S_WEAK        8
  125. #define S_BSS        9
  126. #define S_GROUP        10
  127. #define S_PSEG        11        /* public segment */
  128. #define S_SSEG        12        /* stack segment */
  129. #define S_MSEG        13        /* memory segment */
  130. #define S_CSEG        14        /* common segment (new form) */
  131. #define S_CLASS        15        /* segment class name */
  132.  
  133. #define    S_REG        S_COMN    /* register list */
  134. #define    S_FREG        S_SSEG    /* fp register list */
  135.  
  136. #define ST_TYPE        0x0f    /* type part of symbol type */
  137.  
  138. #define ST_ALIGN    0x70        /* alignment type (for segments) */
  139. #define ST_BYTE        0x00        /* alignment boundarys (byte) */
  140. #define ST_WORD        0x10        /* even */
  141. #define ST_PARA        0x20        /* 16-byte */
  142. #define ST_PAGE        0x30        /* 256-byte */
  143. #define ST_INPAGE    0x40        /* within 256 byte page */
  144.  
  145. /* symbol flags */
  146. #define SF_HAVTYPE    0x01        /* symbol is followed by type info */
  147. #define SF_DATAREF    0x02        /* used for externs in dataseg */
  148. #define SF_HAVCLAS    0x04        /* symbol is followed by class index */
  149. #define SF_GLOBL     0x08        /* symbol is public/extern */
  150. #define SF_HAVSEG    0x10        /* symbol is followed by segment/group # */
  151. #define SF_OVSYM    0x20        /* overlay symbol */
  152. #define S_FIXED        0x40
  153. #define S_UNNAMED    0x80
  154.  
  155. struct symtab {
  156.     char s_type,s_flags;
  157.     unsigned short s_value;
  158. };
  159.  
  160. /* symbol table entry is followed by a segment or group # if the SF_HAVSEG
  161.     flag is set.
  162.  
  163.     Global symbols are followed by a nul terminated string which is the
  164.     name of the symbol.
  165. */
  166.  
  167. #endif
  168.  
  169.